<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      overflow: hidden;
      width: 500px;
      height: 500px;
      background-color: pink;
      margin: 100px auto;
      text-align: center;
    }

    .son {
      width: 300px;
      height: 300px;
      background-color: skyblue;
      margin: 80px auto;
      text-align: center;
      line-height: 300px;
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="son"></div>
  </div>
  <script>
    const f = document.querySelector('.father')
    const s = document.querySelector('.son')
    f.addEventListener('click',()=>{
      alert('我是爸爸')
    })
    s.addEventListener('click',(e)=>{
      alert('我是erz')
      e.stopPropagation()
    })
  </script>
</body>
</html>